<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePolicyCommonUploadTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('policy_common_upload', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('admin_id')->comment('管理员ID');
            $table->string('policy_id')->nullable()->comment('政策ID');
            $table->string('policy_code')->comment('政策代码');
            $table->integer('platform')->comment('上传平台：10=携程，30=去哪，40=同程，50=飞猪，60=美团');
            $table->char('airline',8)->comment('航司');
            $table->char('flight_code',255)->nullable()->comment('航班号');
            $table->string('share_flight_code')->nullable()->comment('共享航班号');
            $table->string("depart_city_code")->comment('起飞三字码');
            $table->string('arrived_city_code')->comment('到达三字码');
            $table->date('depart_at')->comment('日期');
            $table->string('cabin',255)->comment('上传舱位');
            $table->decimal('price')->comment('上传舱位');
            $table->integer('seat')->nullable()->comment('座位数');
            $table->string('ext',128)->nullable()->comment('扩展字段用于回调');
            $table->tinyInteger('status')->comment('状态：-1=删除，0=挂起，1=有效，2=无效，3=待确认');
            $table->tinyInteger('upload_status')->default(1)->nullable()->comment('状态：1=上传中，2=上传成功，3=上传失败，4=更新失败');
            $table->string('upload_msg')->nullable()->comment('上传返回消息');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('policy_common_upload');
    }
}
